#pragma once
#ifndef STENCIL_HPP
#define STENCIL_HPP
#include "glad/glad.h"
#include <cstdint>
namespace Stencil
{
	const uint16_t buffer = GL_STENCIL_BUFFER_BIT;
	enum {always=GL_ALWAYS, if_equal=GL_EQUAL, if_not_equal=GL_NOTEQUAL};
	inline void enable()
	{
		glEnable(GL_STENCIL_TEST);
	}
	inline void mask(GLenum mask_)
	{
		glStencilMask(mask_);
	}
	inline void on()
	{
		mask(GL_TRUE);
	}
	inline void off()
	{
		mask(GL_FALSE);
	}
	inline void func(int when, uint8_t value)
	{
		glStencilFunc(when, value, GL_TRUE);
	}
};
#endif // STENCIL_HPP